﻿namespace Loki.Client
{
    public class LokiQueryBase
    {
        #region primary

        private string _start;
        private string _end;

        #endregion

        public string query { get; set; }

        public string start
        {
            get
            {
                if (startUtc.HasValue)
                {
                    return startUtc.Value.ToUnixNanosecondsString();
                }
                return _start;
            }

            set
            {
                _start = value;
            }
        }

        public string end
        {
            get
            {
                if (endUtc.HasValue)
                {
                    return endUtc.Value.ToUnixNanosecondsString();
                }
                return _end;
            }

            set
            {
                _end = value;
            }
        }

        #region ext

        public DateTimeOffset? startUtc { get; set; }

        public DateTimeOffset? endUtc { get; set; }

        #endregion
    }
}
